import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { TechnicalSupportVO, TechnicalSupportForm, TechnicalSupportQuery } from '@/pagesA/api/workflow/technicalSupport/types';

/**
 * 查询令讯技术支持申请单列表
 * @param query
 * @returns {*}
 */

export const listTechnicalSupport = (query?: TechnicalSupportQuery): AxiosPromise<TechnicalSupportVO[]> => {
  return request({
    url: '/workflow/technicalSupport/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询令讯技术支持申请单详细
 * @param id
 */
export const getTechnicalSupport = (id: string | number): AxiosPromise<TechnicalSupportVO> => {
  return request({
    url: '/workflow/technicalSupport/' + id,
    method: 'get'
  });
};

/**
 * 新增令讯技术支持申请单
 * @param data
 */
export const addTechnicalSupport = (data: TechnicalSupportForm) => {
  return request({
    url: '/workflow/technicalSupport',
    method: 'post',
    data: data
  });
};

/**
 * 修改令讯技术支持申请单
 * @param data
 */
export const updateTechnicalSupport = (data: TechnicalSupportForm) => {
  return request({
    url: '/workflow/technicalSupport',
    method: 'put',
    data: data
  });
};

/**
 * 删除令讯技术支持申请单
 * @param id
 */
export const delTechnicalSupport = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/technicalSupport/' + id,
    method: 'delete'
  });
};
